Fix interpolation when endpoints are same. From Vladimir Nadvornik.
authorrobertl <robertl>
Thu, 19 Oct 2006 20:13:10 +0000 (20:13 +0000)
committerrobertl <robertl>
Thu, 19 Oct 2006 20:13:10 +0000 (20:13 +0000)
grtcirc.c

index 48c227b99ffe45049bd2e2b6509f78d32ef1ad91..44ecf1adf75ccc9397dfca9de74e7e404e572407 100644 (file)
--- a/grtcirc.c
+++ b/grtcirc.c
@@ -286,6 +286,10 @@ void linepart(double lat1, double lon1,
   double phi = 0;
   double cosphi = 0;
   double sinphi = 0;
+
+  /* result must be in degrees */
+  *reslat = lat1;
+  *reslon = lon1;
   
   /* degrees to radians */
   lat1 = RAD(lat1);  lon1 = RAD(lon1);
@@ -306,8 +310,6 @@ void linepart(double lat1, double lon1,
     ya /= la;
     za /= la;
   }
-  *reslat = lat1;
-  *reslon = lon1;
   /* if la is zero, the points are either equal or directly opposite 
    * each other.  Either way, there's no single geodesic, so we punt. */
   if ( la ) {